Copyright: TGL Microsystems


COM 7.1
Com 7.2

Serial/TCPIP terminal emulator

Com is a serial / tcpip terminal emulator. Com allows you to communicate with BBS systems, dial in servers, or even telnet over the internet to another computer.  Com also allows you to transfer files using many different protocols between computers. Loaded with features, Com will make communicating with other computers a breeze.

Com will check your telnet configuration when it starts up and ask you if you want Com to be the default telnet browser. What this means is that you can activate Com by clicking on a telnet link in either MS internet explorer or Netscape navigator.

New this release

Developed by:

 TGL Microsystems

support@tglmicro.com

www.tglmicro.com


New features
New features this release.

Below is a list of a few of the new features this release.

Tray Icon

FTP

Auto Unzip

Security

Aliases

Data Triggers

New script commands - for more powerful scripts. Such as variables, printing, config files, and much more.


Sound events

Setting up wav files for events.

You can set up sound files to be played when certain events occur in Com. There is four events that you can set up sound files for.

On Connect

On Disconnect

On File transfer complete

On File transfer failed

To set up sound files press Com’s <setup/sounds> menu. You will see a window like this:

To change a sound event file just click on the button to the right of the text box. You will then see a directory of your computer. Select a sound file and press <OK>. Note: Com only supports *.wav file formats.


Auto starting
Auto start sessions

Starting up a session automatically.

You can direct com to startup any session when it first starts. Basically this is an ‘Auto-connect’ feature. Any session you have defined in your phone book can be set to autostart. Note: Only one session can be selected for auto-start.

To make a session auto-connect go to Com’s ‘setup/autostart’ You will then see a window like this:

All available sessions will be listed in the left hand list. Double clicking on one will designate that entry as the auto-connect session.

To remove any auto-connect session just press the ‘Clear’ button.


Command line

Com’s command line parameters

Com has some command line functions that allow you to do special startup functions. Below is a list of the parameters that cam be used.

-OPEN <comport #> <baud>

Opens the comport in parameter 1 with a baud rate of parameter 2. Example:  -OPEN 1 57600. This will open Com 1 at 57600 baud. The comport parameters are always 8 data bits, 1 stop bit and no parity.

-START <session>

Starts up a specific session. Example:  -START bbs. This will connect to the session you have named ‘bbs’

-TCP <address> <port>

Starts up a tcpip client connection to the address specified in the second parameter. Example: -TCP gcomm.com 23.  This will do a DNS look up on ‘gcomm.com’ and attempt a connect to it. The <port> parameter is not required and defaults to 23 if there is none.

-SCRIPT <scriptname>

Executes the script in the second parameter. Do not include a full path name. Only use the script file name. Com will look in the ‘scripts’ directory for the script and execute it if its found. Example -SCRIPT BBS.SCR.  Executes the ‘bbs.scr’ script in Com’s script file directory.


Com 7.1 serial terms
Com 7.2

Serial communication terms

Below you will find some terms you may want to familiarize your self with. I am not going to go into great depth about Win95/NT serial communications, but I will explain a few common terms.

Com port

Baud rate

Data bits

Stop bits

Parity

Flow control


Comport
A communications port is the hardware with which Com is going to connect to. This is typically a modem, but can be other devices also. In the typical PC you may have up to 4 comports. These are usually numbered 1 - 4. Under special conditions you may have up to 16 ports.


Baud rate
Simply said, baud rate means speed. The higher the baud rate, the faster you can communicate. Baud rates range typically from 2400 - 115200. 2400 baud means that 2400 bits of information are transmitted over the communications line per second.


Data bits
The term data bits refers to the amount of data bits that are in an 8 bit byte. If this confuses you, don’t worry. 99% of the time you can leave this at 8. CompuServe typically uses 7 bits though.


Stop bits
Stop bits follow the data bits. These bits mark the end of each data byte. Typically this is 1.


Parity
Parity is an error checking method. Normally this will be set to none. You need to know what the remote system requires. Most BBS systems do NOT use parity.


Flow control
Flow control refers to the controlling of the data to and from a communications port. For instance, if data is coming in too fast for a computer to process then flow control is used to pause the incoming data. There are two versions of flow control, hardware and software. Typically hardware flow control is the best.


Com concepts
Com 7.2

Concepts

If you are new to computer communications then you may want to take a peek at some of the terms and concepts below.

File transfers

Terminal emulation

Scripting

Macros


File transfers
Com 7.2

File transfers and protocols

Sooner or later you will most likely need to transfer files between two computers. Unfortunately there are a lot of ways this is done. Com supports most though. File transfers are governed by protocols. Com supports many different protocols. A protocol determines how the file is send, controls error correction and does all the hard communication work for you.

In a typical transfer, one machine will be the receiver and the other machine will be the transmitter. The sender usually starts the sequence first by starting a protocol send. The receiver then starts a receive.The protocol handles the rest. Below is a list of some of the protocols that Com supports. See the file transfer reference for more details

Xmodem

Ymodem

Zmodem

Kermit

Ascii

Compuserve B+

Pure Binary


Xmodem
This is the oldest (or near) file protocol out there. Xmodem is very simple and slow. It transfers data in 128 Byte blocks then waits for an acknowledgment from the receiving system. There are few variations of this protocol:

Xmodem crc: This version uses crc error checking.

Xmodem 1K: This version transmits 1024 byte blocks instead of 128 byte blocks. This speeds up the transfer greatly.

Xmodem 1K G: Same as above except this is a streaming version. It does not wait for the receiver to acknowledge.


Ymodem
This protocol is basically Xmodem1K with a new feature. It allows multiple files to be transferred, one after another. This is called a batch protocol. Another plus is that the transmitter supplies the filename, size and date information to the receiver. Com supports one other mutation of this protocol:

Ymodem G: This is a very fast mutation of Ymodem. It is a streaming protocol that does not perform error checking. It relies on the modem to perform any error correction. You should not even try this protocol unless your modem supports error correction.


Zmodem
Zmodem Is probably the most popular file transfer protocol there is. It is almost as fast as Ymodem G, and can easily recover from errors. It even allows interrupted file transfers to be continued at a later time. This is probably the protocol you should use.


Kermit
Kermit was made to handle file transfers under special  conditions. Conditions like serial data bits of only 7 bits, and transferring between mainframe computers and PCs.


Ascii transfers
Ascii transfers are used to transfer text files. Typically you will want to avoid this protocol unless you are sending text files to special machines or between to different kinds of computers.


Compuserve B+
CompuServe B+ is a protocol that is only used by the on-line service CompuServe. Com only supports the B+ version.


Binary transfer
Com has a special ‘one-way’ protocol. It allows you to send a file in its pure binary format to a decive. Note you cannot receive pure binary(yet). To start a pure binary send just press the ‘Transfer’ button then select ‘Pure Binary’.


Emulation
Com 7.2

Terminal emulation

Terminal emulation simply means how the incoming and outgoing information is translated. Emulation controls how the information is displayed on the screen. This includes colors, graphics, blinking text and cursor position.

Keyboard emulation is a method of translating your key strokes into something that the remote computer can understand. In most cases you can leave this set to ANSI or VT100.

ANSI - This emulation is almost always the default emulation of BBS systems. The emulation provided by Com is a subset of the X3.64 ANSI standard.

VT52, VT100 – VT220 These types are typically found on main-frame computers.

TN3270 - This is a subset of the 3270 telnet emulation. This too is typically found on main-frame computers.

See Terminal Emulation for more details.


Macros
Com 7.2

Macros and their use

Macros are an easy way to perform actions with one mouse click. For instance, you could make a macro for your username and another for your password. When you are prompted for your username just click the username button. Com will send you username to the remote computer.

Com features 50 completely configurable macros that you can define. They are grouped in 5 pages of ten. You may set captions for each page. The macro buttons can be docked also. When docked the macros become part of the main window, usually below the main buttons. See the Macro reference for more details.


Security

Com and Security

Com has a new security feature for admins. With this feature you can set up Com and lock it so users cannot change the settings. This is great for system admins because it allows them to pre configure Com and its connections and not have to worry about users changing options. By default this option is disabled. When you want to setup an admin password go to ‘Setup/Setup/Admin Password’ menu. You will see a dialog like below.

Be default ‘Old Password’ is blank. To enable these security features blank out the Old Password and type in the new password (also be sure to verify it). You should remember this password as it is not easy to recover. To disable the security feature enter you old password and leave the new password blank.

When security is enabled ordinary users do not have access to the following:

1.	Adding, deleteing or changing sessions.

2.	Terminal setup

3.	Creating or changing scripts

4.	Auto start

5.	Directory settings

6.	Logging

If you are an admin and need to access any of these settings you will be asked for the administrator password. Enter the password then you will have unrestricted access.


Unzip settings
Com 7.2

Auto Unzip

Com can automatically unzip compressed files for you after they are downloaded. Below is a screen shot of the configuration options.

Show zip dialog after download.

When checked Com will display a file extraction dialog after the download has completed. This will let you choose the extraction properties, like destination directory and others.

Automatically unzip after download to directory

Com will automatically unzip a compressed archive upon download completion to the specified directory.

Do not unzip after download

Com will not decompress or ask you to decompress after a download.

Extract file path information

When Com extracts the archive the internal file structure is recreated.

Open Explorer in unzipped directory

When selected this option will open the windows explorer in the directory the files were extracted.


FTP
Com 7.2

FTP (File transfer protocol)

FTP is often used to transfer files between computers on the internet or a local network. Com features a fully functional FTP client that’s multi-threaded. This means that Com will not “lockup” while transfering files. You can even run a separate telnet session in Com’s main window while you are transferring files.

The FTP interface is simple enough for even the most timid user. Navigating an FTP server is as easy as navigating your own computer. Drag and drop file transfers also simplify the job.

See FTP Setup

This code is not completely polished and will be expanded upon. We are looking for your suggestions and comments on how we can improve this for you.


Tray Icon
Com 7.2

Tray Icon

The newest feature to Com. You will find this option in the Setup/Setup menu:

This lets you remove Com from the screen and taskbar but still have access to your connection and macros. This feature is relatively new so we are still looking for suggestions.


Script example
Com 7.2

Scripting and Auto scripting

See the Script Referenceand Auto scripting for more info.

Scripting is a way automatically execute instructions depending upon prompts received from the remote session. A good example of this is logging into a BBS. You are prompted for your name or user ID and then prompted for a password. You could have Com watch for these prompts and send your name and password automatically. Suppose you are logging in to a system that prompts you for login information like this:

Script Examples

Basic Login

Variables


Variable Example
Comterm 7.2

Script variable example

;Displays current date in terminal window

SET @D (‘Today is ‘ + @Date)

Display @D

;Asks user what their name is and compares it to

; a raw constant ‘Joe’. The result of the comparison is

; then displayed.

Input ‘Information’ ‘Whats your name?’ ‘’

compare @Lastinput ‘Joe’

if notequal not

display ‘Yes your name is Joe’

goto end

:not

display ‘Your name is not Joe’

:end

; Simple variable addition

SET @X 'Com'

SET @Y '6.9'

SET @Z @X+@Y

DISPLAY @Z


Login example
Comterm 7.2

Simple login example

; Wait for the first name prompt for 20 seconds.

Wait ‘first name’ 20000

;Check for success. If not then exit script

If fail error

;Send your name.

send ‘Tod’

;Wait for the last name prompt for 5 seconds.

Wait ‘last name’ 5000

;Exit script if prompt not found in 5 seconds.

if fail error

;Send last name.

send ‘Liverseed’

;Label

:error


Script reference
Comterm 7.2

Script language

:<label>

;<comment>

CLEARBUFFER

CLEARWINDOW

CAPTURE <ON/OFF/APPEND>

CAPTUREFILE <FILENAME>

CHDIR      <drive:directory>

COMPARE <val1> <val2>

DATABITS   <value>

DELAY      <duration in ticks>

DELETE     <filemask>

DIREXISTS <directory>

DISPLAY  'Just did something'

DONEPORT

DOWNLOAD   <protocol>

EXECFILE <filename>

FILECOPY <source> <destination> <options>

FILEEXISTS <fullpath\Filename>

GOTO     <label>

HIDE

IF       1/2/3...127 <label>

IF        EQUAL <label>

IF       SUCCESS/TIMEOUT/FAIL  <label>

INITPORT   <COM1..COM9> <baud>

INPUT <title> <prompt> <default>

OPENCLIENT   <address>  <port>

PARITY    <value>

PLAYSOUND <sound file>

PRINT <WINDOW/BUFFER>

READCONFIG <section> <key> <default>

SEND     'XXXXXX'

SENDBREAK  <duration in ticks>

SENDFILE <filename>

SET      <option> <data>

    <var> <value>

    ABORTNOCARRIER <true/false>

    CAPTUREFILTER  <data>

    CONFIGFILE  <path>

    RETRY  <data>

    DIRECTORY <drive:directory>

    FILEMASK <filemask>

    FILENAME <filename>

    HWFLOW <option>

    SWFLOW <option>

    WRITEFAIL

    WRITERENAME

    WRITEANYWAY

    ZWRITECLOBBER

    ZWRITEPROTECT

    ZWRITENEWER

    ZSKIPNOFILE <true/false>

SETBINARYFILE

SHOW

SHUTDOWN

STARTBINARY

STOPBITS    <value>

STOPBINARY

UPLOAD       <protocol>

WAIT     'XXXXX' <timeout in ticks>

WAITFORTIME <time>

WAITMULTI  'XXX|ZZZ|YYY', <timeout in ticks>

WRITECONFIG <section> <key> <value>

Functions

@Date

@Lastinput

@Time

@Input

@Uppercase

@Lowercase

Variables

Sending Control Characters and Hex Values


Hex and Control characters
Control characters may transmitted by preceding a character with '^'. For example, a control C character is represented by ^C. You'll use this feature most often when sending carriage returns. For example, SEND 'myname^M' might be an appropriate response to a logon prompt where you would normally type your name and press <Enter>. NOTE: Unlike Object Pascal strings the control characters must be *inside* the quote marks, if quote marks are necessary. You may also send hex values by prefacing them with ‘^$’. An example would be ^$0D. This would send the Ascii value 13


Script Labels
:<label>

A point in the script file that can be jumped to via a GOTO or IF instruction. A label name can be any type of string without embedded spaces. For example ':TopOfLoop', ':TOP_OF_LOOP' are both acceptable;':top of loop' is not.


Script Comments
;<comment>

Any line that starts with a semicolon is considered a comment. Blank lines are also considered comments and may be freely added for readability.


AbortNoCarrier
ABORTNOCARRIER <true/false>

Determines of Com should abort the file transfer if the carrier signal is lost. A value of true makes Com abort if there is no carrier signal.


Capture
CAPTURE <ON/OFF/APPEND>

Turns session capturing on, off, or append.


Capturefile
CAPTUREFILE <filename>

Allow you to set the name of the capture file. If you do not include a full pathname then the file will be located in Comterm's home directory.


ChDir
CHDIR      <drive:directory>

Changes the current drive and/or directory to the one specified by<drive:directory>. If the drive or directory does not exist the FAIL condition is set.


Script Databits
DATABITS   <value>

Allows you to set the comport data bits value. Value may be 5 - 8. You may change this with the comport open or closed.


Delay
DELAY      <duration in ticks>

Delays for <duration in ticks> ticks. The script doesn't yield during delays so keep the delays as short as possible.


Delete
DELETE     <filemask>

Deletes all files matching <filemask>. If no path is specified the current directory is used.


Directory
 K   DIRECTORY <drive:directory>

  Sets the destination directory used during protocol receives.


DirExists
DIREXISTS <directoryname>

Tests existance of a directory. Pass in directory name you are looking for. You then test for success of failure. Example:

DIREXISTS ‘c:\boot.ini’

IF SUCCESS founddir

DISPLAY ‘Directory not found’

GOTO end

:founddir

DISPLAY ‘Dir found’

:End


Display
DISPLAY  'Just did something'

Generates a call to the Script component's OnScriptDisplay eventhandler. If the DisplayToTerminal property is True and a terminal component exists on the form then the string is also displayed to the terminal. This can be used to monitor the progress of the script and to aid in debugging.


DONEPORT

Closes a port previously opened with INITPORT.


Download
DOWNLOAD   <protocol>

Starts receiving files using <protocol>. <protocol> must be one of XMODEM, XMODEM1K, XMODEM1KG, YMODEM, YMODEMG, ZMODEM or KERMIT. If using any of the XModem protocols you must call SET FILENAME before DOWNLOAD to specify the name of the received file.


Execfile
EXECFILE <filename>

Executes a program file. You need to include the entire file path name unless the program is in your current path.


Filemask
   FILEMASK <filemask>

  Sets the file mask used during protocol transfers. For non-batch  protocols this must be a specific file name rather than a mask


Filename
    FILENAME <filename>

  Sets the received file name for protocols that do not transfer the file name (all Xodem protocols).


Filecopy
FILECOPY <source> <destination> <options>

Copies <source> file to <destination> file. <options> determine the following:

NEWER: Copies only if source is newer than destination

DIFFERENT: Copies only if files date/time or CRC is different

ALWAYS: Well…. You know

ABSCENT: Copies only if the destination file doesn’t exist.

Example:

Filecopy c:\autoexec.bat d:\autoexec.bat Always

Unconditionally copies autoexec.bat to d:\


FileExists
FILEEXISTS <fullpath to file>

Tests existance of a file. Pass in the full pathname to the file you are looking for. You then test for success of failure. Example:

FILEEXISTS ‘c:\boot.ini’

IF SUCCESS foundfile

DISPLAY ‘File not found’

GOTO end

:foundfile

DISPLAY ‘File found’

:End


Goto
GOTO <Label>

Transfers control to a line in the script with the specified label. Do NOT include the leading ‘:’ colon character.


IF
IF       SUCCESS/TIMEOUT/FAIL  <label>

Tests the condition set by the last command and, if the tested condition is true, jumps to <label>. If the condition is not true then execution continues with the next statement.


If Equal
IF  EQUAL  <label>

Tests the condition set by the last command and, if the tested condition is true, jumps to <label>. If the condition is not true then execution continues with the next statement. This command is usually used with the COMPARE command. Example:

SET @V1 1

SET @V2 9

:LOOP

DISPLAY @V1

SET @V1 @V1 + 1	(Be sure to include spaces)

COMPARE @V1 @V2

IF EQUAL END

GOTO LOOP

:END


If 1/2/3
IF       1/2/3...127 <label>

Tests the condition set by the last WAITMULTI command and, if the tested condition is true, jumps to <label>. If the condition is not true then execution continues with the next statement.

The following example sends a modem dial command, then waits for one of CONNECT, NO CARRIER, or BUSY responses. If none of the responses are received then control falls through to the GOTO statement:

  send 'atdt260-9726^m'

  waitmulti 'connect|no carrier|busy' 1092

  if 1 HandleConnect

  if 2 HandleNoConnect

  if 3 HandleBusy

  goto HandleTimeout

  :HandleConnect

    ...proceed with session

  :HandleNoConnect

    ...handle noconnect error

  :HandleBusy

    ...handle busy error

  ...


Initport
INITPORT   <COM1..COM9> <baud>

Open the specified port at the specified baud rate. The line parameters are always no parity, 8 data bits and 1 stop bit. Only one port at a time may be opened.


Openclient
OPENCLIENT   <Address>  <Port>

Opens a TCP/IP client connection. <Address> is the address to connect to.  <Port> is the port to connect to. This command is still under development.


Script parity
PARITY    <value>

Sets comport parity. Value may be NONE, EVEN, ODD, SPACE, or MARK. You may change the parity of a comport with the port open or closed.


Playsound
PLAYSOUND <filename>

Plays a windows sound file in the *.wav format. You may or may not include the full path name of the sound file. If you do not supply the full path name, Com will look in its sound directory.


Retry
   RETRY  <data>

  Sets an internal retry count that is incremented whenever WAIT or WAITMULTI result in a TIMEOUT condition. When <retry count> TIMEOUTs have occurred the FAIL condition is set. The default is 1, meaning no retries are attempted.


Send
SEND     'XXXXXX'

Transmits the string 'XXXXXX'. Control characters may transmitted by preceding a character with '^'. For example, a control C character is represented by ^C. You'll use this feature most often when sending carriage returns. For example, SEND 'myname^M' might be an appropriate response to a logon prompt where you would normally type your name and press <Enter>. NOTE: Unlike Object Pascal strings the control characters must be *inside* the quote marks, if quote marks are necessary. You may also send hex values by prefacing them with ‘^$’. An example would be ^$0D. This would send the Ascii value 13. If the string does not contain any embedded blanks the beginning and ending quotes can be omitted. The quotes are required if the string has embedded blanks. Here are some examples to illustrate this point:

If you need to send a ‘^’ then you must ‘escape’ it. Example: SEND ‘test^^’

  SEND ABC      sends ABC

  SEND 'ABC'    sends ABC

  SEND A B C    sends only the A ('B C' is considered a comment)

  SEND 'A B C'  sends A B C


Send break
SENDBREAK  <duration in ticks>

Transmit a break of <duration in ticks> ticks.


SendFile
SENDFILE <filename>

This command sends any file to the remote system. It uses no protocol. It is send just as if you were typing. This could be handy for sending a signature to add to the end of a message or any other need to send a lot of data quickly.


Set
SET      <option> <data>

Sets or resets a variety of script and protocol options. Some options require a <data> argument; some do not.

Option values you may set are:

ABORTNOCARRIER

CONFIGFILE

DIRECTORY

FILEMASK

FILENAME

RETRY

WRITEFAIL

WRITERENAME

WRITEANYWAY

ZSKIPNOFILE

ZWRITECLOBBER

ZWRITEPROTECT

ZWRITENEWER

Set is also used to assign values to variables. Example:

SET @var1 ‘Value’

This sets the variable @Var1 equal to Value.


Script Stop bits
STOPBITS   <value>

Sets the comport stop bits. Value may be 1 or 2. You may change this with the comport open or closed.


SHUTDOWN

When you execute this command Com will terminate the current connection and shutdown. This is really only effective if the “Confirm Hangup On Exit” option is NOT checked.


TICKS

System Bios clock ticks. About 18.2 ticks per second


Upload
UPLOAD       <protocol>

Starts transmitting files using <protocol>. <protocol> must be one of XMODEM, XMODEM1K, XMODEM1KG, YMODEM, YMODEMG, ZMODEM or KERMIT. All files matching the mask previously specified by SET FILEMASK are transmitted.


Wait
WAIT     'XXXXX' <timeout in ticks>

Waits up to <timeout in ticks> ticks for a particular received string. The string comparison is always case insensitive. However, the string comparison need not be complete. If, for example, a host returns the string 'Host XXXX ready' where XXXX might vary from session to session, the WAIT command should wait for 'ready' only. As with the SEND command, beginning and ending quotes are only required if the string contains embedded blanks.

This command sets one of three conditions: SUCCESS, FAIL or TIMEOUT, which can be tested with the IF command. SUCCESS is set if the string is received before the timeout. TIMEOUT is set if the timeout expires before the string is received. FAIL is set if the timeout expires and all retries are exhausted.


Waitfortime
WAITFORTIME <time>

Stalls the script until a specified time. Example:  Waitfortime 20:00:00.  This will stall the script until 8:00:00 PM.


Wait multi
 KWAITMULTI  'XXX|ZZZ|YYY', <timeout in ticks>

Waits up to <timeout in ticks> ticks for one of several substrings. The bar character (|) separates the sub strings. The comparisons are always case insensitive. The maximum length of the entire string is 255characters. As with the SEND command, beginning and ending quotes are only required if the string contains embedded blanks. This command sets a numeric condition result based on the sub string received: '1' is set if the first sub string is received, '2' is set if the second sub string is received, and so on. If none of the strings are received then TIMEOUT is set; if all retries have been exhausted then FAIL is set.


WaiteFail
   WRITEFAIL

  Sets the WriteFailAction property to wfWriteFail for all protocols except ZModem -- meaning that if an incoming file already exists the incoming file is skipped.


HWFLOW
   HFWFLOW <option>

 Sets the hardware flow control option of the comport. Option can be one of the following:

NONE – No hardware flow control

RTSCTS – Use Stanard RTS/STC flow control

DTRDSR – Use standard DTR/DSR flow control


SWFLOW
   SFWFLOW <option>

 Sets the hardware flow control option of the comport. Option can be one of the following:

NONE – No software flow control

RECEIVE – stops a remote device from transmitting while the local receive buffer is too full.

TRANSMIT – stops the local device from transmitting while the remote receive buffer is too full

BOTH – Use both optionsl


    WRITERENAME

  Sets the WriteFailAction property to wfWriteRename for all protocols except ZModem -- meaning that if an incoming file already exists the incoming file is renamed (the first character of the file name is replaced with $).


    WRITEANYWAY

  Sets the WriteFailAction property to wfWriteAnyway for all protocols except ZModem -- meaning that if an incoming file already exists the existing file is overwritten.


    ZWRITECLOBBER

  Sets the ZmodemFileOption property to zfoWriteClobber -- meaning that if an incoming file already exists the existing file is overwritten.


    ZWRITEPROTECT

  Sets the ZmodemFileOption property to zfWriteProtect option --  meaning that if an incoming file already exists the incoming file is skipped.


    ZWRITENEWER

  Sets the ZmodemFileOption property to zfWriteNewer option -- meaning that if an incoming file already exists the existing file is overwritten only if the incoming file is newer.


Capturefilter
CAPTUREFILE <data>

  Sets a filter character for capturing data. This can only be one character. Any occurrence of this character will be stripped from the capture file.


ClearBuffer
CLEARWINDOW

  Clears the terminal window


Input
INPUT <title> <prompt> <default>

This function prompts a user for input. When this executes it displays a dialog box with a title of <title> and a prompt of <prompt>. The user is then inputs a value and it is returned in the @LASTINPUT variable.

Example:

INPUT ‘Login-in information’ ‘Enter your username’ ’noname’

If the user presses the CANCEL button then the default value is returned.


Compare
COMPARE <val1> <val2>

Compare is used to compare two values(usually at least one a variable). The result of the comparison can be evaluated using the IF statement. Example:

SET @var1 ‘One’

SET @var2 ‘Two’

COMPARE @var1 @var2

IF EQUAL EQ

DISPLAY ‘Not Equal’

GOTO END

:EQ

DISPLAY ‘Equal’

:END

This example compares two variables and displays either ‘Equal’ or ‘Not Equal’ in the terminal window depending upon the comparison.


Set Variables
SET <var> <value>

Sets a variable to a value. Variable names MUST begin with a ‘@’ character.

Examples

SET @X ‘Com’

SET @Y ‘6.9’

SET @Z @X + @Y	(Be sure to include spaces)

DISPLAY @Z

Variables hold string values. You may use variables in most places in Com (as you can see by the DISPLAY command above).


CONFIGFILE

Allows you to set the path for a config file. In scripts you may use config files to hold values for you. You may write to and read from config files.

SET CONFIGFILE ‘c:\test.ini’


Readconfig
READCONFIG <section> <key> <default>

Reads a value from a config file. The value is placed in the @LASTINPUT variable. Example

SET CONFIGFILE ‘c:\win.ini’

READCONFIG ‘BOOT’ ‘RUN’ ‘no value’

DISPLAY @LASTINPUT

The value is then displayed in the terminal window


Print command
Print <Window/Buffer>

Directs Com to print either the current window or the entire buffer. The printer output is directed to the default printer.

Example:

PRINT WINDOW


Writeconfig
WRITECONFIG <section> <key> <value>

Writes a value to a config file. You may use either constants or variables for <section>, <key>, or <value>.

Example:

SET CONFIGFILE ‘c:\test.ini’

WRITECONFIG ‘MAIN’ ‘KEY’ ‘VALUE’

This will result in a file looking like this

[MAIN]

KEY=VALUE


CLEARBUFFER

  Clears the terminal window and its entire buffer


ZSkipnofile
 ZSKIPNOFILE <true/false>

  Sets the ZmodemSkipNoFile property to True or False. When this option is True incoming files are skipped if they do *not* already exist on the receiving machine.


Variables
Varibales

Comterm's script language allows you to define variables inside of scripts. This gives you a lot more flexibility in your scripts. For instance you can load configuration values into variables and base script behavior on those values.

To assign a value to a variable you use the SET command. Example:

SET @V ‘HELLO’

This sets the variable @V to the value of ‘HELLO’ Note: your variable names MUST begin with the @ character. Now to access a value of a variable:

DISPLAY @V

This will display ‘HELLO’ on the terminal window.

You may also assign complex values to variables like this:

SET @Name ‘Joe’

SET @V (‘Hell0’ + @NAME)

You may also use integer values in variables. This is handy for looping.

SET @V1 1

SET @V2 9

:LOOP

DISPLAY @V1

SET @V1 @V1 + 1	(Be sure to include spaces)

COMPARE @V1 @V2

IF EQUAL END

GOTO LOOP

:END

This script will loop from 1 to 9 displaying the current value

of the variable @V1.


@DATE

Returns current date.

Example:

SET @D (‘Today is ‘+@Date)

DISPLAY @D


@Time

Returns current time

Example:

SET @D (‘Time is ‘+@Time)

DISPLAY @D


@Lastinput

This is a special variable that holds the result of the last procedure. It is used with commands like READCONFIG and INPUT


@Input
@Input <title> <prompt> <default>

This command operates similar to the INPUT command except the result is returned as a string to a variable or function.

Example:

SET @D @Input ‘Title’ ‘Prompt’ ‘NoDefault’


@Uppercase
@Uppercase <value>

Returns the uppercase of <value>


SetBinaryFile
SetBinaryFile <value>

Sets the name of the file to which binary data from the comport (or Winsock port) will be saved. You must use full pathname. Any existing file will be overwritten.


StartBinary

Starts logging all data coming from the comport (or Winsock port) to a binary file. See SetBinaryFile


StopBinary

Stops a binary logging.


Show

Reactivates and displays Com


Hide

Hides Com from the desktop and the taskbar


@Lowercase
@Lowercase <value>

Returns the lowercase of <value>


Auto scripting
Com 7.2

Auto scripting

Auto scripting is Com’s ability to learn a task then perform it unattended. A good example is logging into a BBS. To tell Com to learn a login just select record from the scripts button. Then dial the entry. Login as normal. Once logged in and waiting at the main menu you can stop the learning process by selecting ‘halt record’ from the script button. Com will then ask you the file name you wish to use. You will then be asked if you want to assign the script you made as the default login script for the entry you are dialing. If you choose ‘Yes’ then Com will execute this script every time you dial the entry.

Note: You may not record a script while executing another. Learning of a script is not allways full proof. Com does a good job trying to figure out whats happening but it may fail on some tasks. When this happens you may need to edit the script by hand.


Macro reference
Com 7.2 Macros

Macro reference

Macros are a way of sending a phrase or command to the remote system with a single mouse click or button press. To use macros you must first set them up.  Lets set up a few macros that send your username and password to a remote BBS system. You can do this with the macros docked or floating.

Setting up macro page captions.

Setting up macro button text.

Setting up macro button captions.

Executing scripts with macros

Executing Programs in macros


Changing macro captions
Com 7.2 Macros

Setting up macro captions.

Just right click on the ‘Page’ bar. Then click on change caption. You may enter pretty much anything you want in there for a caption. You can now do this for all the other pages. Note: be sure to make the page active before changing the caption or you may change the caption of the currently active page. Com will now remember these until you change them.


Macro button captions
Com 7.2 Macros

Macro Text

To change the caption of a button (whether it has one already or not) just right click you mouse over the button you would like to alter. Then click on change caption. Enter the new caption of the button and press enter. Remember to keep the captions short so they fit in the button!


Macro text
Com 7.2 Macros

Changing the macro text.

The macro text is the actual text that will get sent to the remote system when you press the button ( or associated F key). There is a few things to know about the macro text. You can send control characters to the remote system by preceding them with a ‘^’. Sooner or later you will need to know this because to send a carriage return (enter key) to the remote you must add ‘^M’ to the end of the text. Example.

This would send the text “Hi There” to the remote system but would not send a carriage return. You would have to press the enter key before the remote system responded to the command. To do this just change it to this:

Now when you press the macro button “Hi There” and a <cr>  will be sent to the remote. Note control characters must be in caps.

There is also a way to send a hexidecimal code in a macro. To do this preceed the hex code with ‘<H>’. To send the same text as above you could also do this:


Scripts and Macros
Macros and scripts

Executing a script from a macro.

You may at some time want to execute a script from a macro button. This could come in handy for logins or signatures to your mail. The first step is to create the script. See Scripting for more info on creating scripts. You will use the macro command ‘{Script}’ to execute the script file. Do not supply the full pathname for your script. Only supply the script file name. Com will look in the scripts directory for the script file. If one is not found then the macro is aborted.

Example:

When you pressed the macro button it will execute the script file ‘Login.scr’ located in your scripts directory.


Macros and capturing the screen
Macros and the terminal window

Capturing the screen

You can capture the screen at anytime to a file by placing ‘{cap}’ in a macro. Right clicking in the terminal window and selecting the capture menu can also do this.


Macros and programs

Executing programs with macros

You may execute any programs you wish using macros. For instance you may want to launch an off-line mail reader when you receive mail. Or you may want to launch notepad.exe for keeping notes on a session.  Example:

When you click on a macro button that has this text it will run ‘Notepad’.


CR
<cr> means pressing the enter key on your keyboard.


Function key
Function key. F1 though F10.


Ctrl M
This is the equivalent to pressing <ctrl>M or pressing the <enter> key.


File transfers
Com 7.2 File transfers

File transfers - The how-to reference

You at one time or another will need to transfer a file between you computer and a remote computer. Com makes it very easy for you to do this. Below I will guide you through the process.

The first thing you should do is set up your default download and upload directories.

First lets assume you are hooked up to a remote system and you have found the file you wish to transfer from the remote system to your system. Now you must choose the type of protocol you are going to use. Typically Zmodem is the protocol of choice for most people. This protocol is very robust and fast. But you MUST pick a procotol that the remote system supports. Remember that the remote system is in charge, not you.

Now lets assume that the remote system only supports Xmodem and Ymodem. The remote system will ask you the protocol you wish to use. Lets say we choose Ymodem. The remote system then starts sending the file. Now its up to you to start receiving the file. Press the “Transfer” button.

Just click on the Ymodem protocol and press OK. The File transfer status window will then open showing you the details of the transfer. When the transfer is complete the transfer window will disappear. You may cancel a transfer at any time by pressing <esc> or the cancel button.

Sending files is just as easy. Just choose the protocol and select the files to send Com does the rest.


From the main terminal window press the ‘Transfer’ button then choose ‘Download Path’ or ‘Upload Path’. Files you download will be sent into the download directory.


Emulation
Com 7.2

Terminal emulation

What emulation means is how Com interprets incoming and out-going characters. There are many kinds of emulation: ANSI, VT52, VT100, TN3270 and many more. Com supports the first 3 and a subset of the TN3270 emulation. You cant modify the way Com handles incoming characters but you can modify how Com interprets outgoing characters. To do this click on the ‘Setup’ button and choose keyboard. You can then modify the way com handles key strokes.

See Modifying key mapping for more details.


Key editor
 Com 7.2

Modifying the keyboard mapping

You are allowed to change to change the keys that are enabled ‘Blackened’. For instance, to change the way the F1 key reacts just click on the F1 key with your mouse. Below in the mappings you can see the different key codes that are sent in response to pressing F1.

For instance, In the ANSI emulation the key strokes sent when you press  F1 are usually <ESC>OP. This means pressing the escape key then the O then the P keys. You can change this to anything you need to. You can even define different key strokes for  <CTRL>F1.

You may also create your own type too. Just press the New Type button then fill in the mappings you want. Leaving a character blank will make COM use default mappings.

A new notes.

<ESC> sends the ASCII code 27.

<CTRL> send the is like pressing the ctrl button while pressing a key.

<H>xx  sends the hex code xx to the remote system. This may be 00 - FF and must be two characters in length.

Note:	You must use capital letters in the key words <ESC> , <CTRL>, and <H>.


Protocol Options
Com 7.2 - Protocol

Protocol Options

Honor incoming directory

Include outgoing directory

Set RTS low for writes

Abort if carrier lost

Name collision

File options override

Skip if not existing

Crash recovery

8K mode

Auto Zmodem download

File management

Kermit Block length

Kermit Windows

Kermit Timeout

Ascii Inter character delay

Ascii inter line delay

Ascii EOF timeout

CR Translation

LF Translation


Honor Dictory
Determines whether the protocol honors the path name of the incoming file.


Include directory
When you set on, the protocol will send the complete file path for every file it transmits.


RTS low for write
This option is only effective if disk cache is disabled. When this in enabled and hardware flow control is being used Com will lower the RTS line while writing to disk.


Abort on no carrier
 The protocol will abort abort if there is no carrier signal. Do not turn this on when you are using a TCPIP connect.


Name conflict
This determines what COM does with an incoming file already exists. This option does not apply to Zmodem.

Reject - Rejects the incoming file

Rename - Renames the incoming file. The first character in the filename is replaced with a ‘$’. If that file exists it will be overwritten.

Overwrite - Overwrites the file.


Zmodem options override
Causes COM to ignore the senders file options and use its own. Zmodem only.


Skip if non exist
If checked then Com will reject a file is it does NOT exist on the system.


Zmodem recover
This option applies only to sending files. If this option is set the transmitter requests the receiver to resume a file. The receiver responds by sending the current file size. The transmitter then starts sending at that position.


Zmodem 8K
When enabled this causes zmodem to use 8K blocks instead of 1K blocks. Make sure the remote system supports this before checking this box.


Zmodem auto start
This option enabled the Zmodem auto start. When enabled your system will watch for a zmodem transfer and start one when it detects an incoming file. Default is ON.


Zmodem options
These are the Zmodem file options

Newer or longer - Transfer if the file is new, newer or longer.

CRC different - This option is not supported and reserved for future use.

Append - Transfer the file is it is new, append if the file exists.

Overwrite - Overwrite the existing file.

Newer - Transfer the file only if it is either new or newer.

Different - Transfer if new or different file dates or lengths.

Reject - Transfer only if a new file.


Kermit block length
This option sets the maximum kermit packet length in bytes. Default = 80.


Kermit windows
If 1-27 then Kermit will use sliding windows to speed transfers.


Kermit time out
Determines how many seconds Kermit will wait for the next byte.


Ascii char delay
Number of milliseconds to wait between each character.


Ascii line delay
Number of milliseconds to wait between each line.


Ascii EOF
Number of seconds before the ASCII transfer automatically ends.


Ascii CR translation
Determines what COM does with a CR in an ASCII transfer


Ascii LF translation
Determines what COM does with a LF in an ASCII transfer


Selecting files
Com 7.2 - File transfers

Selecting files to upload

Selecting files is easy. You may drag and drop from the directory boxes above or from the windows explorer. To eliminate a single file from the list just double click on it.

Note: When you drop a directory in the box ALL subdirectories are also selected. If you were to drop your root drive (‘C:\’), It may take several seconds to scan through all the directories. When you are complete press the OK button. The file transfer will then begin.


Setting comport params
Com 7.2 - Comport parameters

Setting the parameters of a comport

If you ever have the need to directly connect to a communications port then you will need to set the parameters. See Serial terms for more info.

In most instances you will want to use RTS/CTS hardware flow control. Try to never have more than one type of flow control enabled at the same time. The Initialize string is sent to the comport after it has been opened. You may leave this blank or put a modem initialization string here, example:

AT&F1^M

Note you must follow the init string with a ^M for most modems. This acts like a carriage return.


Entries
Com 7.2 - Entries

Creating a new entry

Creating a new entry in the phone book is real easy. From the main phonebook window press the New button. You will then see the entry properties page. Since Com supports both serial and TCPIP connects you need to decide what type of a connect you are making.

Serial (Modem) connect:

•	Make up a name and place it in the name box.

•	Make sure the serial check box is checked.

•	Type in the phone number (if any).

•	Choose the decive you want to use.

•	To ‘wait for call’ check the ‘wait for call’ box..

•	Select a startup script (advanced users) if needed.

•	Press OK.

0	TCPIP (Internet) connect:

•	Make up a name and type it in the name box.

•	Place a check in the TCPIP box.

•	Type in  the address or IP of the remote computer.

•	Type in the port.

•	Choose the mode of connect. Client makes the call, server waits for a call.

•	Click OK.

Few notes on TCPIP connects. You may use names for the ports also. Example ‘telnet’ is the same as putting 23 here. When you are in server mode, you are only allowed to have one connect at a time due to the limitations of the file transfers etc.


Terminal options
Com 7.2 - Terminal

Terminal options.

Just click on the setting you are wondering about.


Fore color
Click here to set the fore color. This is the text and graphics color. Note: ANSI, VT100, and TN3270 will ignore this setting most of the time.


Bold fore color
Clicking here will set the terminal color to be bold. This does not effect the font size.


Ignore background color
When checked this will make Com ignore all incoming background color commands. In other words, if you set the background color to be blue, it will stay blue, always.


Back color
Set the terminals background color. This change does not happen immediately, you must either clear the terminal window or make the remote system refresh the screen.


Bold back color
Makes the background color be bold. Example, to have a pure white background check the ‘white’ color option and check the ‘bold’ box.


Terminal font
Click here to change the terminal font. NOTE: to display ANSI graphics correctly you must use either the ComFont or Terminal font.


Terminal emmulation
Select the emulation for the terminal window. See emulation for more details


Key emulation
Select the keyboard mapping you wish to use. See keyboard mapping for more details.


Process Extended
If selected then com will process extended key strokes, line F1-F12, arrow keys etc.


Process all
If selected then Com will process all alpha numeric keys.


Map function keys
When checked Com will not process the function keys. Instead F1 - F10 keys will be mapped to Macro 1 through Macro 10 on the currently displayed macro page.


Trace port
Selected this will trace comport/tcpip activity to a file called ‘COM.TRC’. All characters send and received will be displayed in this file. This is mainly a trouble shooting option.


CR Translation
When checked this will translate the <enter> key into <enter><linefeed>.


CR and LF
When checked Com translates the <enter> key into <linefeed><enter>.


Doorway mode
This is a special terminal emulation. When checked COM will send the raw key strokes to the remote system. Do not use this unless you are sure of what you are doing.


Log port
Mainly for trouble shooting procedures. This will log Com’s internal workings in response to communication events.


Rows
The amount of rows that Com’s terminal window will display.


Columns
The number of columns that Com’s terminal window will display.


Registering
Com 7.2 - Registering

How to register COM

Com was designed for two reasons. It seems that good, cheap communications software is impossible to find. The software is either no good or is over-blown for the average user. The other reason for Com’s existence is because we like to write code.

Registering Com will entitle you to free updates (for ever!) free technical support, and will remove the startup splash screen.

To register send a check or money order to:

TGL Microsystems

PO Box 422

Morristown MN

55052

View our web site for current pricing.

You must add 6.5% sales tax to all orders in Minnesota.

You may also register via credit card at: www.tglmicro.com

Also specify the name you wish the program to registered to. I will send out the registration codes via e-mail, fax or snail mail. Just specify which.

Customizing and custom programming also are available.

Email your requests, comments, or suggestions to:

support@tglmicro.com

www.tglmicro.com


Icons
Session Icons

Using icons for your sessions

You can use any icons you want for your sessions. To add icons to the list of available icons copy the *.ico files into coms icon directory. This is usually ‘C:\Program files\Tgl Micro\Com\Icons’. You may also press the ‘Add an icon’ button. This lets you add an icon to the list by using a file dialog.

Removing an icon is real easy. Just select the icon you want removed and click the ‘Delete an icon’ button. Note if you have and sessions that use this icon their icon will change.

If Com is running when you place the new icons in the directory you will need to refresh the Icon list. In Com’s Icon window click on the ‘Refresh list’ button. Note: Adding or deleting icons will change the icons of your current sessions.


Ole Automation
Com 7.2

Ole Automation

Ole Automation is a process by which you can control Com with from other applications. While still in its infancy, it is none the less a very powerful tool. We will continue to build on it as time goes on. Currently there is only a very small subset of commands and properties.

Because Com is multi-threaded there is some special considerations you must take into account when making calls to it. For instance when you tell com to start a session the function call will return immediately. Com will process the request in the background. You must periodically check the Online property to see if Com connected of not. We are currently working on a better approach to this.

OLE Examples

Methods

Properties


Ole Automation Reference
Com 7.2

Ole Automation Reference

Starting up Com

The Ole object you will use is 'Com69.ComApp' When you create an instance of this OLE object Com will start. You should declare a global variant variable that will refer to this object. If you use a local variable the variable becomes invalid wihen the procedure or function is exited. This will cause Com to shut down.

DELPHI Example: This example declares the global variable 'fOleObj'. Then when the form is created Com will start up.

var

  Form1: TForm1;

  fOleObj:    Variant;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);

begin

   fOleObj:=CreateOleObject('Com69.ComApp');

end;

VisualBasic: Same thing is accomplished here except its in a button click

DIM OleObj as Variant 	' Make sure this is a global

Private Sub Command1_Click()

    Set Com69 = CreateObject "Com69.ComApp"

End Sub

Once you have the Ole Object created then you can use all of its properties and methods. Below is a short list of what Com will support in its current state:

Methods

Properties

SAMPLE VB Code


VB Sample
Com 7.2

VB Sample Ole Automation application

This code will Start Com, Connect to a session, then transfer a file then shut down.

Dim State As Integer

Dim Com69 As Variant

Const Connecting = 1

Const SendingFile = 2

Const Exiting = 3

Private Sub Start_Click()

    Set Com69 = CreateObject "Com69.ComApp"

    Com69.Hide

    Com69.Connect  "BBS"

    State = Connecting

    Timer1.Enabled = True

End Sub

Private Sub Timer1_Timer()

    If State = Connecting Then

        If Not Com69.Connected Then Exit Sub

        Com69.FileProtocol = "ZMODEM"

        Com69.SendFile "C:\Autoexec.bat"

        State = SendingFile

        Exit Sub

    End If

    If State = SendingFile Then

        If Com69.FileInProgress = True Then Exit Sub

        Com69.Disconnect

        State = Exiting

        Exit Sub

    End If

    If State = Exiting Then

        If Com69.Connected = True Then Exit Sub

        Com69 = Empty

        Timer1.Enabled = False

    End If

End Sub


Ole Automation Methods
Com 7.2

OLE Automation methods

CaptureStart

Starts a terminal capture. All data sent to the terminal will be saved in the file specified by the CAPTUREFILE property.

CaptureStop

Stops terminal capture

CaptureAppend

Starts a capture session and appends the terminal data to the file specified by the CAPTUREFILE property.

ClearWindow

Clears the terminal window.

ClearBuffer

Clears the terminal buffer.

Close

Closes comport

Connect <session name>

Connects to session named by the first parameter

Disconnect

Disconnects from any active session

Hide

Minimizes Com

Open

Opens the comport

Receive <Filename>

Starts a file download. If the file protocol is other than ASCII or Xmodem then the filename parameter will be ignored as the remote system sends the incoming filename.

Send <data>

Sends <data> to the comport. <data> is of string type. Method returns immediately.

SendBinary <Filename>

Sends a file using binary transfer protocol. This method ignores settings of the Yield property. It is completely multi threaded. You must check the FileInProgress property to determine when the transfer has completed.

Show

Shows Com

SendFile <Filename>

Sends a file with the file protocol set be the FileProtocol property

WaitForString <data>, <ticks>

Com waits for a string <data> to appear in the data stream. It will wait <ticks> for the string. Ticks is a measure of bios clock ticks. Each tick is equal to about 1/18 of a second. If the string is found within the allowed time the method returns true else it returns false.


Ole Properties
Com 7.2

OLE Automation properties

Baud

Read/Write  - Gets or Sets serial baudrate. Legal values are: 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200.

Capturefile

Read/Write Gets or sets the terminal capture file for capturing a session.

Comport

Read/Write. Gets or sets current comport number. If the comport is open when this is changes the current comport is closed then re-opened with the new comport number.

Connected

Read only - Returns true if com is connected to a remote system.

Databits

Read/Write – Get or Set comport databits.

DownloadDir <directory>

Both read and write. You can set the directory that incoming files will be sent to.

FileProtocol <protocol>

Sets the protocol to use. Valid values are 'ZMODEM', 'YMODEM', 'XMODEM', 'ASCII', and 'YMODEMG'

FileInProgress

Read only - This property returns true if Com is currently in a file transfer

FlowControl

Read/Write – Get or set comport flowcontrol. Values can be: NONE, HARDWARE, SOFTWARE, BOTH.

Parity

Read/Write. Get or set parity. Values are: NONE, EVEN, ODD, MARK, SPACE

Stopbits

Read/Write – Get or set comport stopbits.

Yield <true/false>

This property decides whether Com will yield on file transfers. If set to True then when you start a file transfer the call to the OLE method will return immediately. You must test the FileInProgress property to determine if Com is still busy. If yield is set to false, the call to the OLE method will not return until the file is transferred. Default is True.


Alias
Aliases

Aliases Defined

Aliases allow you to define words or phrases that execute commands for you. An alias can send a line of text or create a data trigger. Their use is infinite. Aliases greatly enhance Com’s usefullness.

Defining Aliases

Internal command reference

Data triggers


Defining Aliases
Aliases

Defining aliease

To define aliases you use the alias editor. This is basically a small text editor. In the future Com may have a more graphical interface but this will get you started.

From Com’s main screen tool bar press the setup button. Then press the setup/aliases option. You will then see the editor. Here you define your aliases. An alias consists of a ‘/’ and a name. Example:

/name /say Joe anonymous

When you use the command line option in com you could type in ‘/name’ and Com would send ‘Joe Anonymous’ to the comport or telnet session. Com automatically adds the necessary CR and LF if needed.

If you want Com to send more than one line then the alias would look like this:

/name /say Joe

/name /say Anonymous

This would send the line ‘Joe’ and the line ‘Anonymous’

An alias can also call another alias.

/login /name

/login /password

/name /say Joe Anonymous

/password /say secret

Executing the alias /login will first run the alias /name then the alias /password

Com has many internal commands that you can use either from the command line or in aliases. To see these commands please read the command line option reference.


Alias commands
Aliases

Command reference

/ADDTRIGGER – Adds a data trigger.

syntax: /Adddatatrigger <name> <start> <end> <cmd>

parameters:

<name> Name of the trigger

<start> Start sequence (use quotes to enclose <space> characters)

<end> End sequence (use quotes to enclose <space> characters)

<cmd> Alias to execute when trigger fires

/ALIAS – Shows you the alias editor

/CASE statement

syntax: /CASE <condition> <cmd>

parameters: <condition> A string or set of values to evaluate trigger data against

“value” or “num..num2”

example: “10” – executes the alias <cmd> if the data returned by the trigger = “10”

example: “10..20” executes the alias <cmd> if the data returned by the trigger is >=10 and <=20

/CAPTURESCREEN – Captures screen to file

syntax: /Capturescreen <filename>

parameters: <filename> full pathname of the file to capture data into.

/CASEEND – Ends a set of case statements. This is required for /Case statements

syntax: /CASEEND

example:

/Alias1 /CASE “10” /Dotencmd

/Alias1 /CASE “11..20” /Do10to20

/Alias1 /CASE “20..100” /DoOvertwenty

/Alias1 /CASEEND

/CLEAR – Clears the screen

/DATE – Returns system date

/DIAL – Connects to a session

syntax: /DIAL <session>

parameters: <session> Name of the session to connect to

/DISABLETRIGGER – Disables a trigger but does not remove it

syntax: /DISABLETRIGGER <name>

parameters: <name> Trigger to disable

/DISP – Displays text on the terminal window but does not sent it to the remote system

syntax: /DISP <text>

parameters: <text> Everything after the disp command is sent to the terminal window

/ENABLETRIGGER – Enables a trigger

syntax: /ENABLETRIGGER <name>

parameters: <name> Trigger to enable

/HANG – Hangs up the current connection

/HELP – Displays help

/PRINT – Prints either the window or the whole buffer to the current printer

syntax: /PRINT Window or /Print Buffer

/QUIT – Shuts down Com

/REMOVEALL – Removes all data triggers.

/REMOVETRIGGER – Remove specified trigger

syntax: /REMOVETRIGGER <name>

parameters: <name> Removes named trigger

/SAY – Send text to remote system

syntax: /SAY <text>

parameters: <text> Sends all text to the remote system

/TIME – Returns the current time.

/WAIT – Waits for given amount of seconds

syntax: /WAIT <secs>

parameters:

/WAITFOR – Wait for a string form the remote system

syntax: /WAITFOR <string> <timeout>

parameters: <string> String to wait for

<timeout> Seconds to wait for.


Data Triggers
Aliases

Data triggers

Data triggers are probable the most powerful part of Com. They are also the most difficult to understand. Data triggers watch the data stream for a start sequence of characters and an ending sequence of characters. When these two conditions have been met the data trigger will return the data that came between the start and end sequence.

Example:

Lets say you are playing your favorite online MUD and want Com to perform a certain action when your hit points drop below a certain value. The server you connect to sends you a string like such: <100//95> <90/90>.

Now lets say the first value of 100 is you hit point maximum and the second value is your current hit points. You could set up a trigger that performs certain actions depending on the current value of your hit points

/hptrg /addtrigger hp1 "//" "> " /hp

{This line adds the trigger. Start sequence is ‘//’ and end sequence is ‘> ‘. Study the server line above and you will see these characters in the line. What we are interested in is the values in-between the start and end sequences (which is 95)}.

/hp /case “0..20” /hplow

/hp /case “21..50” /hpmedium

/hp /case “51..99” /hpok

/hp /case “100” /hpgreat

/hp /caseend

{This case statement evaluated the data that the data trigger returned. And it executes the alias specified if the value if one of the conditions are met}

/hplow /say say "I am dying!"

/hpmedium /say say "I am feeling bad"

/hplow /say say "I am feeling OK"

/hplow /say say "I am great!!!"

{These are the aliases that are executes}

To activate this trigger all you need to do is type /hptrg in the command line. The trigger will remain in effect until you remove it. There is no need to re-enable it.

You can also use data triggers to look for simple strings, example:

/login /dial mysession

/login /addtrigger nametrg “Log” “in:” /sendname

/login /addtrigger passtrg “Pass” “word:” /sendpassword

{Dials a session then dds two triggers that watch for ‘Login:’ and ‘Password:’}

/sendname /say Joe Anonymous

/sendname /removetrigger nametrg

{Sends username and remove trigger}

/sendpassword /say secret

/sendpassword /removetrigger passtrg

{Send password and remove trigger}

Ok… Now when you type /login in the command line prompt this alias will dial a session named “mysession” and add two triggers. One watched for “Login:” and the other watches for “Password:”. When these are detected it sends out the appropriate data.

This is more or less still in its beta stage and I am very interested in comments and suggestions.


FTP Setup
Com 7.2

FTP Setup

Default Port In most cases you can leave this at 21. Do not change this unless you know what you are doing.

Retries Tells Com how many times to connect to the remote FTP server.

Firewall host Enter your firewall host here. Leave this blank if you don’t know what a firewall host is or ask your system admin.

Firewall Port Enter the port of the firewall host.

Use Firewall If you are behind a network firewall then check this option. If you don’t know or aren’t sure then uncheck this option.

Anonymous Login The username Com will use to log into a FTP server anonymously. In most cases you don’t need to change this.

Anonymous Password The password Com will use for anonymous logins.


FTP Login
Com 7.2

FTP Login

Host This is the address of the remote system. You may use a full host name (like above) or you can use an IP address.

Port of the remote FTP server. In most cases this will be 21.

Retries Number of times Com will attempt to connect to the remote server.

Login The username you wish to use. In most cases this will be anonymous. If anonymous is not allowed then you will need to contact the system administrator for a valid username.

Password to the remote system. If you use anonymous login then this can be your email address.

Use Firewall If checked this will tell Com to navigate out through a network firewall. Currently Com only supports user@host:port style firewalls. If you do not know what a firewall is then leave this unchecked.

Use Anonymous This will automatically fill in the Login and Password that is used for Anonymous logins. You can change this in FTP Setup.


FTP Connections
Com 7.2

FTP Connection properties

Connection Name This is the name you will refer to this connection. This can be most anything… well… within reason/

FTP Host name This is the name of the host (or IP address) that you want to connect to.

Port: Remote port number. Usually this is 21.

Login Name is the name, which you will use to log into the FTP server with.

Password is the password to log into the FTP server. Com stores all passwords encrypted. This is so a potential hacker isn’t able to view your passwords.